package at.ac.tuwien.mg.bean;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Item implements Serializable {

	private static final long serialVersionUID = 4312326433602002034L;
	private int amount;
	private String good;
	private double price;
	
	public Item() {}
	
	public Item(String good, int amount) {
		this.good = good;
		this.amount = amount;
	}
	
	public Item(String good, int amount, double price) {
		this.good = good;
		this.amount = amount;
		this.price = price;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getGood() {
		return good;
	}

	public void setGood(String good) {
		this.good = good;
	}

	public double getTotal() {
		return amount * price;
	}
	
	public String toString() {
		return "[" + good + ", " + amount + ", " + price + "]";
	}

}
